<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: huajie <banhuajie@163.com>
// +----------------------------------------------------------------------

namespace Admin\Model;
use Think\Model;
use Admin\Model\AuthGroupModel;

/**
 * 文档基础模型
 */
class LeavewordModel extends Model{
    public function update($data = null){
        $data = $this->create($data);
        //var_dump($data);exit;
        if(empty($data)){
        return false;
        }
        if(empty($data['id'])){
            $id = $this->add();
            if($id){
                $this->error = '新增基础内容出错';
                return false;
            }

        }else{
            $status = $this->save();
            if(false===$status){
                $this->error = '更新基础内容出错';
                return false;
            }
        }
        return $data;
    }
}
